Repository navigation
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks, Dan. A sketch that sits a fraction of a square off is a real gap, and this is a small, clean change. Two things before we take it:
How this would land: this repository is the published copy. Development happens in a separate repository, and each release is exported from it here, so merging into |
offset_x/offset_y moved the image by a delta, so a retried call moved it twice. position=[x, y] sets where the image's centre sits instead, so repeating it is harmless. It is applied after center and scale, and a later center puts the image back at the map's centre, as the docstring now says. Checked live: the position is written to the map file's trace_image block and comes back in a freshly started Dungeondraft. A trace_image UAT group covers set, retry, center, and save-and-reopen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks. Both points are addressed in bbc2fd2.
|
|
Thanks, Dan. Your version is what landed: One change to the UAT: the reopen now waits 16 s inside the case, as the save round-trip case does. Dungeondraft logs It also saves the map again after clearing the trace, so the file no longer points at the deleted temp image. Separately, loading a trace after a These commits are authored by you in the development repository, so you will show as a contributor here when the release lands. This PR stays open until then and closes with a link to that release. |
Problem
set_trace_imagecan scale and centre a reference image, but it can't move it. A sketch whose squares match the map's afterscaleusually still sits a fraction of a square off. A client traced a sketch at 23 px per square, and the image ended up 0.37 of a square off in x and 0.26 in y, with no way to fix it.Change
set_trace_imagegainsposition: [x, y], in woxels (256 per square): where the image's centre sits. Aftercenterit reads exactly the map centre.offset_x/offset_y; a retry moved the image twice, so those were dropped after review.)centerandscale. A latercentermoves the image back to the map's centre and discards the position, and the docstring says so.positionon its own is a complete call._set_trace_imagesets theTraceImagesprite's position. If no image is loaded, it returns an error.position, which is where the image sits after the call (whenever an image is loaded).docs/PROTOCOL.mdlists the key.Validation
python server/tools/gate.py: all checks passed. That includesserver/tests/test_trace_position.py, with 10 tests.trace_imageblock ("position": "Vector2( 2148, 1988 )"). After a full restart of Dungeondraft on that map, the image came back at[2148, 1988].trace_imageUAT group: set a position, repeat it, check thatcenterresets it, then save,open_map, and read it back. It passes.Docs
The
set_trace_imageentry in the tool reference needs thepositionparameter and result field.🤖 Generated with Claude Code